<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The CairoOperator class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairomatrix.translate.html">CairoMatrix::translate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.cairopath.html">CairoPath</a></div>
 <div class="up"><a href="book.cairo.html">Cairo</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.cairooperator" class="reference">

 <h1 class="title">The CairoOperator class</h1>
 

 <div class="partintro"><p class="verinfo">(No version information available, might only be in Git)</p>


  <div class="section" id="cairooperator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    This is used to set the compositing operator for all cairo drawing operations.
   </p>
   <p class="para">
       The default operator is <strong><code>CairoOperator::OVER</code></strong>
   </p>
   <p class="para">
       The operators marked as unbounded modify their destination even outside of the mask layer (that is,
       their effect is not bound by the mask layer). However, their effect can still be limited by way of clipping.
   </p>
   <p class="para">
       To keep things simple, the operator descriptions here document the behavior for when both source and destination
       are either fully transparent or fully opaque. The actual implementation works for translucent layers too.
       For a more detailed explanation of the effects of each operator, including the mathematical definitions,
       see http://cairographics.org/operators/.
   </p>
  </div>


  <div class="section" id="cairooperator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">CairoOperator</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.clear"><var class="varname">CLEAR</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.source"><var class="varname">SOURCE</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.over"><var class="varname">OVER</var></a></var>
     <span class="initializer"> = 2</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.in"><var class="varname">IN</var></a></var>
     <span class="initializer"> = 3</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.out"><var class="varname">OUT</var></a></var>
     <span class="initializer"> = 4</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.atop"><var class="varname">ATOP</var></a></var>
     <span class="initializer"> = 5</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.dest"><var class="varname">DEST</var></a></var>
     <span class="initializer"> = 6</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.dest-over"><var class="varname">DEST_OVER</var></a></var>
     <span class="initializer"> = 7</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.dest-in"><var class="varname">DEST_IN</var></a></var>
     <span class="initializer"> = 8</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.dest-out"><var class="varname">DEST_OUT</var></a></var>
     <span class="initializer"> = 9</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.dest-atop"><var class="varname">DEST_ATOP</var></a></var>
     <span class="initializer"> = 10</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.xor"><var class="varname">XOR</var></a></var>
     <span class="initializer"> = 11</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.add"><var class="varname">ADD</var></a></var>
     <span class="initializer"> = 12</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.cairooperator.html#cairooperator.constants.saturate"><var class="varname">SATURATE</var></a></var>
     <span class="initializer"> = 13</span>
    ;</div>

    
   }</div>


  </div>
  

  <div class="section" id="cairooperator.constants">
   <h2 class="title">预定义常量</h2>
   <dl>


    
     <dt id="cairooperator.constants.clear"><strong><code>CairoOperator::CLEAR</code></strong></dt>

     <dd>

      <p class="para">Clear destination layer (bounded)</p>
     </dd>

    

    
     <dt id="cairooperator.constants.source"><strong><code>CairoOperator::SOURCE</code></strong></dt>

     <dd>

      <p class="para">Replace destination layer (bounded) </p>
     </dd>

    

    
     <dt id="cairooperator.constants.over"><strong><code>CairoOperator::OVER</code></strong></dt>

     <dd>

      <p class="para">Draw source layer on top of destination layer (bounded) </p>
     </dd>

    

    
     <dt id="cairooperator.constants.in"><strong><code>CairoOperator::IN</code></strong></dt>

     <dd>

      <p class="para">Draw source where there was destination content (unbounded) </p>
     </dd>

    

    
     <dt id="cairooperator.constants.out"><strong><code>CairoOperator::OUT</code></strong></dt>

     <dd>

      <p class="para">Draw source where there was no destination content (unbounded) </p>
     </dd>

    

    
     <dt id="cairooperator.constants.atop"><strong><code>CairoOperator::ATOP</code></strong></dt>

     <dd>

      <p class="para">Draw source on top of destination content and only there </p>
     </dd>

    

    
     <dt id="cairooperator.constants.dest"><strong><code>CairoOperator::DEST</code></strong></dt>

     <dd>

      <p class="para">Ignore the source </p>
     </dd>

    

    
     <dt id="cairooperator.constants.dest-over"><strong><code>CairoOperator::DEST_OVER</code></strong></dt>

     <dd>

      <p class="para">Draw destination on top of source </p>
     </dd>

    

    
     <dt id="cairooperator.constants.dest-in"><strong><code>CairoOperator::DEST_IN</code></strong></dt>

     <dd>

      <p class="para">Leave destination only where there was source content (unbounded) </p>
     </dd>

    

    
     <dt id="cairooperator.constants.dest-out"><strong><code>CairoOperator::DEST_OUT</code></strong></dt>

     <dd>

      <p class="para">Leave destination only where there was no source content </p>
     </dd>

    

    
     <dt id="cairooperator.constants.dest-atop"><strong><code>CairoOperator::DEST_ATOP</code></strong></dt>

     <dd>

      <p class="para">Leave destination on top of source content and only there (unbounded) </p>
     </dd>

    

    
     <dt id="cairooperator.constants.xor"><strong><code>CairoOperator::XOR</code></strong></dt>

     <dd>

      <p class="para">Source and destination are shown where there is only one of them </p>
     </dd>

    

    
     <dt id="cairooperator.constants.add"><strong><code>CairoOperator::ADD</code></strong></dt>

     <dd>

      <p class="para">Source and destination layers are accumulated </p>
     </dd>

    

    
     <dt id="cairooperator.constants.saturate"><strong><code>CairoOperator::SATURATE</code></strong></dt>

     <dd>

      <p class="para">Like <strong><code>CairoOperator::OVER</code></strong>, but assuming source and dest are disjoint geometries </p>
     </dd>

    

   </dl>

  </div>



 </div>

 

</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairomatrix.translate.html">CairoMatrix::translate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.cairopath.html">CairoPath</a></div>
 <div class="up"><a href="book.cairo.html">Cairo</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
